<%--                                                                       --%>
<%-- Copyright (c) 2004-2005 BroadVision, Inc.  All rights reserved.       --%>
<%--                                                                       --%>
<%-- This software is copyrighted. Under the copyright laws, this software --%>
<%-- may not be copied, in whole or in part, without prior written consent --%>
<%-- of BroadVision, Inc. or its assignees. This software is provided      --%>
<%-- under the terms of a license between BroadVision and the recipient,   --%>
<%-- and its use is subject to the terms of that license.                  --%>
<%--                                                                       --%>
<%-- This software may be protected by one or more U.S. and International  --%>
<%-- patents.  Certain applications of BroadVision One-To-One software are --%>
<%-- covered by U.S. patent 5,710,887.                                     --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and BroadVision One-To-One are registered     --%>
<%-- trademarks of BroadVision, Inc., in the United States and the         --%>
<%-- European Community, and are trademarks of BroadVision, Inc., in other --%>
<%-- countries.  The BroadVision logo, is a trademark of BroadVision,      --%>
<%-- Inc., in the United States and other countries. Additionally, IONA    --%>
<%-- and Orbix are trademarks of IONA Technologies, Ltd.  RSA, MD5, and    --%>
<%-- RC2 are trademarks of RSA Data Security, Inc.                         --%>
<%--                                                                       --%>

<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>
<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean-el" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

<script language="JavaScript">

<%@ include file="/mc/common/jsutils.jsp" %>

</script>

<% String ctxPath = request.getContextPath(); %>

<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="content area">
  <tr>
    <td valign="top" width="100%">
      <div class="pageTitle">
      	<bean-el:message key="ep.report.title" bundle="ep.messages"/>: <bean-el:message key="ep.report.list.channel.program.user" bundle="ep.messages"/>
      </div>
      <div class="errorMessage"><html-el:errors bundle="ep.messages"/></div>
      <div class="pageSubtitle">
        <span class="left"><bean-el:message key="ep.report.search.criteria" bundle="ep.messages"/></span>
      </div>

      <table class="labelForm" width="100%" border="0" cellspacing="0" cellpadding="0" summary="report">
        <tr>
          <td class="label" width="20%">
            <bean-el:message key="ep.report.label.channel.program.select.user" bundle="ep.messages"/>:
          </td>
          <td class="labelField" width="80%">
            <c:out value="${userName}"/>
          </td>
        </tr>		
        <tr>
          <td class="label" width="20%">
            <bean-el:message key="ep.report.label.channel.program.pageType" bundle="ep.messages"/>:
          </td>
          <td class="labelField" width="80%">
            <c:out value="${pageTypeName}"/>      
          </td>
        </tr>
      </table>
    
      <div class="breadcrumb">
        <c:if test="${not empty epChannelBrowseView.map.breadcrumbs}">
          <c:forEach var="channel" items="${epChannelBrowseView.map.breadcrumbs}" varStatus="status">
            <c:url var="browseUrl" value="/ep/channelProgramByUserReportNavigate.do">
              <c:param name="channelId" value="${channel.map.id}"/>
              <c:param name="id" value="${id}"/>
              <c:param name="pageTypeId" value="${pageTypeId}"/>
              <c:param name="pageTypeTopLevelChannelId" value="${pageTypeTopLevelChannelId}"/>
            </c:url>
            <c:if test="${channel.map.id == pageTypeTopLevelChannelId}">
              <c:set var="position" value="${status.count}" />
            </c:if>
            <c:choose>
              <c:when test="${status.count >= position}"> 
              /&nbsp;<a href="<c:out value="${browseUrl}"/>"><c:out value="${channel.map.name}"/></a>
            </c:when>
            <c:otherwise>
              /&nbsp;<c:out value="${channel.map.name}"/>
            </c:otherwise>
            </c:choose>
          </c:forEach>
        </c:if>
      </div>
	  
      <!--- show channels --> 	  
      <div class="pageSubtitle">
          <span class="left"><bean-el:message key="ep.channels" bundle="ep.messages"/></span>
      </div>	

      <html-el:form action="/ep/channelProgramByUserReportNavigate.do">
      <input type="hidden" name="channelId"/>
      <input type="hidden" name="ctx.f" value="<c:out value="${requestScope['ctx.f']}"/>"/>

      <table class="dataTable" border="0" cellspacing="1" cellpadding="2" summary="Search result table" width="100%">
        <tr class="listHeader">
          <th id="Name" align="left" width="20%"><bean-el:message key="ep.header.name.channel" bundle="ep.messages"/></th>
          <th id="Description" align="left" width="30%"><bean-el:message key="ep.header.description" bundle="ep.messages"/></th>
          <th id="Status" align="left" width="10%"><bean-el:message key="ep.header.status" bundle="ep.messages"/></th>
        </tr>

        <!-- results -->
        <c:forEach var="item" items="${epChannelBrowseView.map.channels}" varStatus="index">

          <c:url var="browseUrl" value="/ep/channelProgramByUserReportNavigate.do">
            <c:param name="channelId" value="${item.map.id}"/>
            <c:param name="id" value="${id}"/>
            <c:param name="pageTypeId" value="${pageTypeId}"/>
            <c:param name="pageTypeTopLevelChannelId" value="${pageTypeTopLevelChannelId}"/>
          </c:url>

          <c:choose>
            <c:when test="${(index.count + 1) % 2 == 0}">
              <tr class="listEven">
            </c:when>
            <c:otherwise>
              <tr class="listOdd">
            </c:otherwise>
          </c:choose>

          <td headers="Name">
            <a href="<c:out value="${browseUrl}"/>"><c:out value="${item.map.name}"/></a>
          </td>

          <td headers="Description">
            <c:out value="${item.map.description}"/>
          </td>

          <td headers="Status">
            <c:choose>
              <c:when test="${item.map.status == 0}">
              	<bean-el:message key="ep.label.offline" bundle="ep.messages"/>
              </c:when>
              <c:otherwise>
                <bean-el:message key="ep.label.online" bundle="ep.messages"/>
              </c:otherwise>
            </c:choose>
          </td>
          </tr>
        </c:forEach>
      </table>
    </html-el:form>

      <!-- pagination -->
	  <c:if test="${not empty epChannelBrowseView.map.channels}">
	  	<%@ include file="/mc/common/pager.jsp" %>
	  </c:if>

	  <!--- show programs --> 
	  <c:if test="${epChannelBrowseView.map.channelId != 0}">
      <br>
      <div class="pageSubtitle">
        <span class="left"><bean-el:message key="ep.programs" bundle="ep.messages"/></span>
      </div>

      <form name="epProgramBrowseForm" method="post">
        <table class="dataTable" border="0" cellspacing="1" cellpadding="2" summary="Search result table" width="100%">
          <tr class="listHeader">
  
            <th id="Name" align="left" width="20%"><bean-el:message key="ep.header.name.program" bundle="ep.messages"/></th>
            <th id="Description" align="left" width="30%"><bean-el:message key="ep.header.description" bundle="ep.messages"/></th>
            <th id="Status" align="left" width="10%"><bean-el:message key="ep.header.status" bundle="ep.messages"/></th>          
          </tr>
  
          <!-- results -->
          <c:forEach var="item" items="${epChannelBrowseView.map.programs}" varStatus="index">
            <c:choose>
              <c:when test="${(index.count + 1) % 2 == 0}">
                <tr class="listEven">
              </c:when> 
              <c:otherwise>
                <tr class="listOdd">
              </c:otherwise>
            </c:choose>
  
            <td headers="Name">
              <c:out value="${item.map.name}"/>
            </td>
            <td headers="Description">
              <c:out value="${item.map.description}"/>
            </td>
            <td headers="Status">
              <c:choose>
                <c:when test="${item.map.status == 0}">
                  <bean-el:message key="ep.label.offline" bundle="ep.messages"/>
                </c:when>
                <c:otherwise>
                  <bean-el:message key="ep.label.online" bundle="ep.messages"/>
                </c:otherwise>
              </c:choose> 
            </td>
            </tr>
          </c:forEach>
        </table>
      </form>

      <!-- pagination -->
      <c:if test="${not empty epChannelBrowseView.map.programs}">
        <%@ include file="/mc/common/pager2.jsp" %>
      </c:if>
    </c:if>

    </td>
  </tr>
</table>
